import cv2
from ultralytics import YOLO

model=YOLO(r"yolo11n.pt")

results =model(
    source=0,
    stream=True,
)
for result in results:
    plotted = result.plot()
    cv2.imshow( "YoL0 Inference", plotted )
    if cv2.waitKey(1) & 0xFF == ord ("q"):
        break

cv2.destroyAlLWindows()